package com.guoheng.hazard.sys.controller.subsystem;


import com.guoheng.hazard.common.base.Result;
import com.guoheng.hazard.manager.subsystem.SubsystemManager;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: safe
 * @description: 子系统登录
 * @author: fbl
 * @create: 2019-11-06 16:47
 **/
@RestController
@Validated
@Api(value = "子系统登录")
public class SubsystemLoginController {

    @Resource
    SubsystemManager subsystemManager;

    /**
     * 子系统登录
     * @return Result
     */
    @PostMapping(value = "basic/subsystem/login")
    public Result subsystemLogin() {
        return subsystemManager.getLoginUrl();
    }

    /**
     * 子系统退出登录 清除token
     * @return Result
     */
    @PostMapping(value = "basic/subsystem/loginOut")
    public Result subsystemLoginOut() {
        return subsystemManager.loginOut();
    }

    /**
     * 子系统实时空气质量
     * @return Result
     */
    @GetMapping(value = "basic/subsystem/airQuality")
    public Result airQuality() {
        return subsystemManager.airQuality();
    }

    /**
     * 子系统水质接口
     * @return Result
     */
    @GetMapping(value = "basic/subsystem/waterQuality")
    public Result waterQuality() {
        return subsystemManager.waterQuality();
    }

}